﻿/*====================================================================================================
	TASK 5:                                                               { Operators and Expressions}
	Write a boolean expression for finding if the bit 3 (counting from 0) of a given integer is 1 or 0.    
====================================================================================================*/

using System;

class FindingThirdBit
{
    static void Main()
    {
        uint number = 25;
        //Console.WriteLine(Convert.ToString(a, 2).PadLeft(32, '0'));
        Console.WriteLine("number {1} in binary is:{0}",Convert.ToString(number, 2),number);
        
        uint mask=1<<3;
        uint numberAndmask=number & mask;
        uint thirdBit= numberAndmask >> 3;

        if (thirdBit==1)
        {
            Console.WriteLine("Third bit is:1");
        }

        else
        {
            Console.WriteLine("Third bit is:0");
        }

    }
}

